import { axios } from '@/utils/request'

const api = {
  genService: '/gen/smartServer'
}
export function getGenServiceInfo (id) {
  return axios({
    url: api.genService + '/get/'+id,
    method: 'get'
  })
}
export function getGenServiceList (parameter) {
  console.info(api.genService)
  return axios({
    url: api.genService + '/list',
    method: 'get',
    params: parameter
  })
}

export function saveGenService (parameter) {
  return axios({
    url: api.genService+(parameter.serviceId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delGenService (parameter) {
  return axios({
    url: api.genService + '/remove',
    method: 'post',
    params: parameter
  })
}

export const genServiceExport = api.genService + '/export'
